package utils

// Min Min
func Min(a, b int) (c int) {
	if a >= b {
		return b
	}
	return a
}

// Max Max
func Max(a, b int) (c int) {
	if a > b {
		return a
	}
	return b
}

// MinInt64 MinInt64
func MinInt64(a, b int64) (c int64) {
	if a >= b {
		return b
	}
	return a
}

// MaxInt64 MaxInt64
func MaxInt64(a, b int64) (c int64) {
	if a > b {
		return a
	}
	return b
}

func MinFloat64(a, b float64) (c float64) {
	if a >= b {
		return b
	}
	return a
}

func MaxFloat64(a, b float64) (c float64) {
	if a > b {
		return a
	}
	return b
}

func TransferMap(idsMap map[int64]bool) (ids []int64) {
	ids = make([]int64, 0)
	for id := range idsMap {
		ids = append(ids, id)
	}
	return
}

func NumberLen(n int64) int {
	i := 0
	for n > 0 {
		n /= 10
		i++
	}
	return i
}
